<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$data=array_fields(array('appkey','appsecret','token','status'),$postdata);
		$this->plugin_setting('basic',$data);
		exi('设置成功');
	}
	$return['item']=$this->plugin_setting('basic');
	$return['item']['apiurl']=custom_url('jy_polyapi/api/',true);
	$htmls=array(
		'type'=>'edit',
		'desc'=>'参数设置',
		'tabs'=>$tabs,
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基本设置',
				'list'=>array(
					array('type'=>'copy','title'=>'接口访问地址','name'=>'apiurl','help'=>'申请网店管家：http://huoban.wdgj.com/'),
					array('type'=>'string','title'=>'AppKey','name'=>'appkey'),
					array('type'=>'string','title'=>'AppSecret','name'=>'appsecret'),
					array('type'=>'string','title'=>'Token','name'=>'token'),
					array('type'=>'switch','title'=>'是否开启接口','name'=>'status'),
				)
			),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}

